home *** CD-ROM | disk | FTP | other *** search
- @if-using not(ocl-file-error-buff)
- @use (ocl-file-error-buff)
- ;OCL{{{}}}
- ;OCL{{{ reference description
- @if-using ( FUN-REFERENCE ) ; 1 ;
- This libary defines the function `show-error-buffer'. It opens a new
- buffer with file `dev/null', inserting all stored messages ( Origami
- stores all messages in a special history!).
- @fi
- ;OCL}}}
- ;OCL{{{ libaries
- @if-using not(ocl-file-hide-buffer) @lib hide-buffer @fi
- @if-using not(ocl-file-buff-size) @lib buff-size @fi
- ;OCL}}}
- ;OCL{{{ variables
- ( defvar ( err-buff-caller err-buff-x err-buff-dummy ) )
- ;OCL}}}
- ;OCL{{{ local functions
- ( deffun ( rename ) get-error-msg
- ( if test-view
- ( delete-mode-view
- get-error-msg(rename)
- add-mode-view
- )
- else
- (
- ;OCL{{{ get number of msg's
- history-edit error-list ()
- do
- ( previous-line
- set modify-behaviour +(modify-behaviour 1)
- )
- while not(test-begin-line)
- newline-and-indent
- ;OCL}}}
- ;OCL{{{ put msg's
- while >(modify-behaviour 0)
- ( beginning-of-line
- newline-and-indent
- previous-line
- get-history error-list modify-behaviour
- set-file-unchanged
- next-line
- set modify-behaviour -(modify-behaviour 1)
- )
- ;OCL}}}
- if rename
- ;OCL{{{ rename the buffer
- ( change-buffername
- "message-history
- newline-and-indent
- set-file-unchanged
- )
- ;OCL}}}
- fi
- )
- fi
- )
- )
- ;OCL}}}
- ;OCL{{{ show-error-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; show-error-buffer-called
- ;OCL{{{ @error-buff-ref show-error-buffer
- Displayes a buffer with file `dev/null', inserting all stored
- messages ( Origami stores all messages in a special history!) and
- offers a menu for contolling the display of the buffer.
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun show-error-buffer
- ( set err-buff-caller current-buffer-id
- open-hidden-dummy-buffer(true)
- full-size-buffer
- set err-buff-dummy current-buffer-id
- get-error-msg(true)
- screen-on
- redraw-display
- ;OCL{{{ prompt for next
- local
- ()
- ( do
- (
- ;OCL{{{ up/down or quit
- set err-buff-x 1
- begin-prompt-macro
- menu-counter
- err-buff-x
- ( "Up " "Quit " "Down " " "Left " "Right )
- end-prompt-macro
- ;OCL}}}
- case
- ;OCL{{{ show next page
- ( =(err-buff-x 0) ( previous-page ) )
- ;OCL}}}
- ;OCL{{{ show previous page
- ( =(err-buff-x 2) ( next-page ) )
- ;OCL}}}
- ;OCL{{{ shift left
- ( =(err-buff-x 3) ( repeat screen-width ( backward-character ) ) )
- ;OCL}}}
- ;OCL{{{ shift right
- ( =(err-buff-x 4) ( repeat screen-width ( forward-character ) ) )
- ;OCL}}}
- default
- ;OCL{{{ break from loop, new target found
- ( return-from-macro )
- ;OCL}}}
- esac
- )
- while true
- )
- ;OCL}}}
- ;OCL{{{ return to calling buffer
- screen-off
- leave-hidden-dummy-buffer(err-buff-caller)
- set err-buff-dummy 0
- ;OCL}}}
- )
- )
- ;OCL}}}
- ;OCL{{{ open-error-buffer
- ;OCL{{{ reference
- @if-using ( FUN-REFERENCE ) ; 2 ; open-error-buffer-called
- ;OCL{{{ @error-buff-ref open-error-buffer
- Opens a new buffer with file `dev/null', inserting all stored
- messages ( Origami stores all messages in a special history!).
- ;OCL}}}
- @fi
- ;OCL}}}
- ( deffun open-error-buffer
- ( screen-off
- ;OCL{{{ get dev/null buffer
- local
- ( modify-behaviour )
- ( set modify-behaviour -2
- open-buffer
- )
- ;OCL}}}
- get-error-msg(false)
- screen-on
- redraw-display
- )
- )
- ;OCL}}}
- ;OCL{{{ reference hooks
- @if-using ( FUN-REFERENCE ) ; 3 ;
- The libary defines a macro `abort-hook-add' and a OCL tag
- ABORT-HOOK-ADD. This macro should be added to your abort-macro! If
- needed, an existing macro `abort-hook-add' will be integrated!
-
- show-error-buffer uses `begin-prompt-macro' and `end-prompt-macro' to
- get the right mode for reading the commands.
- @fi
- ;OCL}}}
- ;OCL{{{ abort-hook-add
- @if-using not(ABORT-HOOK-ADD)
- @use (ABORT-HOOK-ADD)
- ( defmac abort-hook-add ( ) )
- @fi
- ( defmac abort-hook-add-saved ( abort-hook-add ) )
- ( undeclare ( abort-hook-add ) )
- ( defmac abort-hook-add
- ( abort-hook-add-saved
- if err-buff-dummy
- ( goto-buffer-id err-buff-dummy
- set err-buff-dummy 0
- set-file-unchanged
- exit-buffer
- goto-buffer-id err-buff-caller
- restore-buffer-layout
- )
- fi
- )
- )
- ( undeclare ( abort-hook-add-saved ) )
- ;OCL}}}
- ;OCL{{{ undeclares
- ( undeclare ( err-buff-caller err-buff-x err-buff-dummy get-error-msg ) )
- ;OCL}}}
- @fi
-